﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:simpleType name="GuidType">
    <xs:restriction base="xs:string">
      <xs:pattern value="\{[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\}"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="NotWhiteSpaceString">
    <xs:restriction base="xs:string">
      <xs:minLength value="1"/>
      <xs:whiteSpace value="collapse"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:element name="FieldDefinitions">
    <xs:complexType>
      <xs:sequence minOccurs="0" maxOccurs="unbounded">
        <xs:element name="FieldDefinition">
          <xs:complexType>
            <xs:all>
              <xs:element name="Type" minOccurs="1" maxOccurs="1" nillable="false" type="NotWhiteSpaceString"/>
              <xs:element name="DesignTemplate" minOccurs="1" maxOccurs="1" nillable="false" type="NotWhiteSpaceString"/>
            </xs:all>
            <xs:attribute name="Id" type="GuidType" use="required"/>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
